package com.michael.demos.springboot.openapi.db;


import com.michael.demos.springboot.openapi.entity.AppUser;

import java.util.HashMap;
import java.util.Map;

/**
 * 类功能描述:
 * <pre>
 *   模拟数据库
 * </pre>
 *
 * @author Michael
 * @version 1.0
 * @date 2020/11/26 16:10
 */
public final class DB {

    public static Map<String, AppUser> appUserMap = new HashMap<>();

    public static AppUser getAppUser(String appKey) {
        return appUserMap.get(appKey);
    }

    public static void putAppUser(AppUser appUser) {
        appUserMap.put(appUser.getAppKey(), appUser);
    }

    public static void removeAppUser(String appKey) {
        appUserMap.remove(appKey);
    }
}
